<div id="buscabarra">
<table width="100%" border="0" cellpadding="0" cellspacing="0">
<form action="buscar.php" method="get" onsubmit="javascript: if($('#mybox').attr('value') == 'Digite aqui sua busca'){ return false; $('#mybox').css('border:','solid 1px #f00')};">
<input type="hidden" value="todas" name="cat" />
<tr>

<td width="42%" valign="middle"><input disabled="true" name="customerNumber" size="16" type="hidden" />
  <input name="busca" type="text" class="buscainput search_field" id="mybox" onBlur="if(this.value==''){this.value='Digite aqui sua busca';}; this.style.color='#CCC'; this.style.fontStyle='italic'" onClick="if(this.value=='Digite aqui sua busca'){this.value=''}; this.style.color='#333'; this.style.fontStyle='normal'; this.style.boder='solid 2px #ccc';" value="<?php if(!$_GET["busca"]){ echo "Digite aqui sua busca"; }else{ echo $_GET["busca"];} ?>" size="60" autocomplete="on" />
  <input type="hidden" name="estado" value="2" >
  <!--  <option value="2" <? if($_GET["estado"]==2 OR !isset($_GET["estado"])){ echo "selected";} ?>>Novos e Usados</option>
  <option value="1" <? if($_GET["estado"]==1){ echo "selected";} ?>>Novos</option>
  <option value="0" <? if(isset($_GET["estado"]) and $_GET["estado"]==0){ echo "selected";} ?> >Usados</option>-->
  
  </select></td>


<td width="58%" valign="middle">&nbsp;  <input type="submit" class="gh-bt" style="cursor:pointer" value="Buscar!" /></td>


</tr>


</form>
</table>
</div>




<script> 
    new Autocomplete("busca", function() { 
        this.setValue = function(id) {
            document.getElementsByName("customerNumber")[0].value = id;
        }
        if (this.isModified) this.setValue("");
        if (this.value.length < 1) return ;
        return "lib/busca-principal.php?q=" + this.value;
    }); 
</script>

